package DMSXL._2023Before.String_;

/*public class pathEncryption_ {
    public static void main(String[] args) {
        Solution solution = new Solution();
        System.out.println(solution.pathEncryption( "We are happy."));
    }
}
class Solution {
    public String pathEncryption(String path) {
        if(path.length() == 0)
            return path;
        char[] ch = path.toCharArray();
        int extral = 0;
        for (int i = 0; i < ch.length; i++) {
            if(ch[i] == ' ')
                extral++;
        }
        char[] newch = new char[ch.length + extral*3];
        int last = newch.length - 1;
        for (int i = ch.length - 1; i >= 0; i--) {
            if(ch[i] == ' '){
                newch[last--] = '0';
                newch[last--] = '2';
                newch[last--] = '%';
            }else {
                newch[last--] = ch[i];
            }

        }
        return String.valueOf(newch);
    }
}*/